/**
 title
 html 
 width
 height
*/
var openGBox = function (title , html , width , height  ){
	this.title  = title;
	this.html   = html;
	this.width  = width;
	this.height = height;
	if(typeof(this.title)=="undefined" || this.title=='') this.title= '标题';
	if(typeof(this.width)=="undefined" || this.width=='') this.width= 300;
	if(typeof(this.height)=="undefined" || this.height=='') this.height= 150;
	var Gbox = '<div class="gbox_bg"></div>'
		Gbox += '<div class="gbox_box">';
		
		Gbox += '<div class="gbox_box_main">';
		Gbox += '<div class="gbox_box_title">';
		Gbox += '<h3>'+this.title+'</h3>';
		Gbox += '<a class="gbox_box_close" href="javascript:closeGBox();" title="关闭"></a>';
		
		Gbox += '<span style="clear:both;"></span>';
		Gbox += '</div>';
		Gbox += '<div class="gbox_box_content">'+this.html+'</div>';
		//Gbox += '<div class="gbox_box_bottom"></div>';
		Gbox += '</div></div>';
		$(document.body).append(Gbox);
		var top  = $(document).scrollTop()+($(window).height()-this.height)/2+"px";
		var left = (document.body.clientWidth-this.width)/2+"px";
		$(".gbox_bg").css("height", $(document.body).height()+"px");
		$(".gbox_box").css("width",  this.width+"px");
		$(".gbox_box_content").css("height", (this.height-31*2)+"px");
		$(".gbox_box").css("top",top);
		$(".gbox_box").css("left",left);
}
var closeGBox = function(){
	$(".gbox_bg").remove();
	$(".gbox_box").remove();
}